package com.hubu.test.clazz;

public class Person {
    private int age;
    private String name;
    private Person (){
        System.out.println("Person Constructor");
    }
    public static void main(String[] args) {

        /**
         *
         * 运行时候决定的
         */
        try {
            Class<?> aClass = Class.forName("com.hubu.test.clazz.Person");
            try {
                Object o = aClass.newInstance();
                System.out.println(o);
            } catch (InstantiationException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }

        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
